﻿<%@ Page Title="" Language="C#" MasterPageFile="~/GUI/MasterPages/MasterPage2.master"
    AutoEventWireup="true" CodeFile="Admin.aspx.cs" Inherits="GUI_Pages_Admin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder3" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder4" runat="Server">
    <div id="header">
        <h4>
            Admin System</h4>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <br>
            
            <h4 align="center">
                <asp:Button ID="Button1" runat="server" OnClick="applicants_Click" 
                    Text="Applicants" />
                &nbsp;
                <asp:Button ID="Button2" runat="server" OnClick="babysitters_Click" 
                    Text="Babysitters" />
            </h4>
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
                DataKeyNames="BSID" DataSourceID="SqlDataSource1" EnableModelValidation="True" 
                Font-Names="Arial" Font-Size="10pt" ForeColor="#333333" GridLines="None" 
                HorizontalAlign="Center" 
                OnSelectedIndexChanged="GridView1_SelectedIndexChanged" PageSize="15" 
                Width="820px">
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                <Columns>
                    <asp:CommandField ShowSelectButton="True" />
                    <asp:BoundField DataField="BSID" HeaderText="BSID" InsertVisible="False" 
                        ReadOnly="True" SortExpression="BSID" />
                    <asp:BoundField DataField="BSName" HeaderText="BSName" 
                        SortExpression="BSName" />
                    <asp:BoundField DataField="CellNo" HeaderText="CellNo" 
                        SortExpression="CellNo" />
                    <asp:CheckBoxField DataField="Interviewed" HeaderText="Interviewed" 
                        SortExpression="Interviewed" />
                    <asp:CheckBoxField DataField="Trained" HeaderText="Trained" 
                        SortExpression="Trained" />
                    <asp:CheckBoxField DataField="PaidTraining" HeaderText="Paid for Training" 
                        SortExpression="PaidTraining" />
                </Columns>
                <EditRowStyle BackColor="#999999" />
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" 
                    HorizontalAlign="Left" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            </asp:GridView>
            <br />
            <div align="center">
                <asp:Label ID="Label1" runat="server" Font-Names="Arial" Font-Size="12pt" 
                    ForeColor="White" Text="No Results." Visible="False"></asp:Label>
                <br />
            </div>
            </br>
  
        </ContentTemplate>
    </asp:UpdatePanel>
    <h4 align="center">
        <table align="center">
            <tr>
                <td style="width: 137px">
                    Filter by area
                </td>
                <td>
                    :
                </td>
                <td>
                    <asp:DropDownList ID="filterbyarea" runat="server" Width="200px">
                        <asp:ListItem Value="0">All</asp:ListItem>
                        <asp:ListItem>Mohandessin</asp:ListItem>
                        <asp:ListItem>Dokki</asp:ListItem>
                        <asp:ListItem>Agouza</asp:ListItem>
                        <asp:ListItem>Zamalek</asp:ListItem>
                        <asp:ListItem>Maadi</asp:ListItem>
                        <asp:ListItem>6th of October</asp:ListItem>
                        <asp:ListItem>5th Settlement - Kattameya</asp:ListItem>
                        <asp:ListItem>Heliopolis</asp:ListItem>
                        <asp:ListItem>Nasr City</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td style="width: 137px">
                    Filter by language
                </td>
                <td>
                    :
                </td>
                <td>
                    <asp:DropDownList ID="filterbylanguage" runat="server" AppendDataBoundItems="True"
                        DataSourceID="SqlDataSource3" DataTextField="BLanguage" DataValueField="LanguageID"
                        Width="200px">
                        <asp:ListItem Value="0">All</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
        </table>
    </h4>
    <h4 align="center">
        <asp:Button ID="Filter" runat="server" Text="Filter" OnClick="Filter_Click" Width="63px" />
    </h4>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CSConn %>"
        SelectCommand="SELECT b.BSID, b.BSName, b.CellNo, a.Interviewed, b.Trained, b.PaidTraining
FROM BabySitters b INNER JOIN Accounts a 
ON b.AccountID = a.AccountID
WHERE a.Approved = 'True'" OldValuesParameterFormatString="original_{0}"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:CSConn %>"
        SelectCommand="SELECT [BSName], [AccountID], [DoB] FROM [BabySitters] WHERE ([BSID] = @BSID)">
        <SelectParameters>
            <asp:ControlParameter ControlID="GridView1" DefaultValue="" Name="BSID" PropertyName="SelectedValue"
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:CSConn %>"
        SelectCommand="SELECT [LanguageID], [BLanguage] FROM [Languages]"></asp:SqlDataSource>
    <br />
    <br />
</asp:Content>
